<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<button>+</button>
<button>-</button>
<p id="pp" style="font-size: 16px">你好</p>

<input id="text" type="text">

</body>

<script>

    var btn = document.getElementsByTagName("button")
    for (var i=0;i<btn.length;i++){
        btn[i].addEventListener("click", function () {
            var p = document.getElementById('pp')
            var old = p.style.fontSize.slice(0,-2)
            console.log(old)
            if (this.innerText==='+'){
                // p.style.fontSize =
            }
        },false)
    }



    //键盘事件
    text.onkeydown = function (e) {
        console.log(e.keyCode)
    }


    //窗口事件
    window.onresize = function (e) {
        console.log(e)
        console.log(window)
    }
</script>

</html>